#include"process.h"

#define TARGET 1024*1024
#define DOWNLOAD 5000


void download(callback_t cb)
{
  int cur = 0;
  while(1)
  { 
    cur += DOWNLOAD;
    int rate = (cur*100)/(TARGET);
    if(rate > 100)
      rate = 100;
    if(rate > 73)
    {
      rate = 73;
    }
    cb(rate);
    if(rate >= 100)
      break;
    usleep(10000);
  }
  printf("\n");
}

int main()
{
  download(process_v2);

  return 0;
}
